#ifndef TRANSFORMNODE_H_
#define TRANSFORMNODE_H_

#include "node.h"
#include <list>
#include "../library.h"

class TransformNode : public Node {
public:
	TransformNode(GLfloat x, GLfloat y, GLfloat z) {
		this->x = x;
		this->y = y;
		this->z = z;
	}

	void render() {
		list<Node*>::iterator it = children.begin();
		if (it == children.end()) {
			return;
		}

		glPushMatrix();
		glTranslatef(x, y, z);
		while (it != children.end()) {
			it->render();
			++it;
		}
		glPopMatrix();
	}

	void addChild(Node* n) {
		n->parent = this;
		children.push_back(n);
	}
protected:
	list<Node*> children;
	GLfloat x, y, z;
};



#endif /* TRANSFORMNODE_H_ */
